package com.cqc.retrofitdemo02.http;

import com.cqc.retrofitdemo02.AppRequest;
import com.cqc.retrofitdemo02.event.RequestTag;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.scalars.ScalarsConverterFactory;

/**
 * Created by cui on 2016/12/24.
 */

public class HttpRequest {
   public  void post4(String key, int areaId) {

        //1 创建retrofit对象
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(NetUrl.BASE_URL)
                .addConverterFactory(ScalarsConverterFactory.create())
                .build();
        //2 获取我们已经创建的接口AppUrl
        AppRequest appRequest = retrofit.create(AppRequest.class);
        //3 调用我们创建的方法，获取call
        Call<String> call = appRequest.post1(key, areaId);

        new MainRequest().postString(call, RequestTag.POST4);
    }
}
